package com.medical.mapper;

import com.medical.model.param.Messages;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.*;

/**
 * @author TISNIW
 * @version 1.0
 * @desc
 */
@Mapper
public interface  ChatMessagesMapper {

    @Select("select * from chat_messages where session_id = #{sessionId} order by created_at asc")
    List<Messages> getChatParameters(String sessionId);
    @Insert("insert into chat_messages (session_id, role, content) values (#{sessionId}, #{user}, #{prompt})")
    int insertMessage(String sessionId, String user, String prompt);
    @Insert("insert into chat_messages (session_id, role, content, thinking) values (#{sessionId}, #{user}, #{prompt}, #{thinking})")
    int insertMessageAI(String sessionId, String user, String prompt, String thinking);
}
